li r3, 10               // r3 represents array A
li r4, 110              // r4 represents array B
li r9, 10               // row size of array.

li r2, 0

outerloop:			; for (i = 0; i < 10; i++)
mv  r15, r9
sub r15, r2     		; r2 = i
blez r15, endouterloop


  
li r1, 0
innerloop:			; for (j = 0; j < 10; j++)
mv   r15, r9
sub r15, r1
blez r15, endinnerloop


store r2, 0(r3) 
addi r3, 1


store r1, 0(r4) 
addi r4, 1


addi r1, 1
bez r0, innerloop
endinnerloop:
addi r2, 1 			; i++
bez r0, outerloop
endouterloop:
//****************************2nd multiple loop*********************8

	; r1 = i
	; r2 = j
	; r3 = A
	; r4 = B
	; r5 = rowsize(A,B)= 10

li    r3, 10               // r3 represents array A
li    r4, 110              // r4 represents array B
li    r5, 10

li  r1, 1
li r6, 0
li r6, 9			; Loop limit
outerloop1:			; for (i = 1; i < 9; i++)
mv  r15, r6
sub  r15, r1
blez r15, endouterloop1


li r2, 1
innerloop1:			; for (j = 1; j < 9; j++)

mv  r15, r6
sub r15, r2
blez r15, endinnerloop1


 ; r10 = accumulator
mv r11, r1
addi r11, -1

mul r11, r5
add r11, r2
add r11, r3
load  r10, 0(r11)      // A[i-1, j]

mv  r11, r1
addi r11, 1
mul r11, r5
add r11, r2
add r11, r3
load  r9, 0(r11)      // A[i+1, j]
add r10, r9

mv  r11, r1
mul r11, r5

add r11, r2
addi r11, 1
add r11, r3
load  r9, 0(r11)      // A[i, j+1]
add r10, r9

mv  r11, r1
mul r11, r5

add r11, r2
addi r11, -1
add r11, r3
load  r9, 0(r11)      // A[i, j-1]
add r10, r9

sra r10, 2			; div by 4

mv  r11, r1
mul r11, r5
add r11, r2
add r11, r4
store r10, 0(r11) 

addi r2, 1
bez  r0, innerloop1
endinnerloop1:

addi r1, 1
bez   r0, outerloop1
endouterloop1:

